package com.bzg.baseSpringComponent.messagesource;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

import java.util.Locale;

/**
 * ApplicationContext实现了MessageSource，具有消息国际化的功能
 * 消息国际化
 * */
public class MessageSourceStyle {

	public static void main(String[] args) {
		AnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext(Config.class);
		// 从messages_enc.properties中获取test的值
		String message = applicationContext.getMessage("test", null, new Locale("enc"));
		System.out.println(message);
	}

}
